import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int N=scanner.nextInt();
        double []arr=new double[N];
        double []arr2=new double[N];
        for(int i=0;i<N;i++){
            int a=scanner.nextInt();
            int b=scanner.nextInt();
            arr[i]=a/(a+b);
            arr2[i]=a/(a+b);
        }
        int []arr1=new int[N];
        int sum=0;
        int s=N-1;
        Arrays.sort(arr2);
        for(int i=0;i<N;i++){
            for(int j=0;j<N;j++) {
                if(sum!=0) {
                    if (arr[j] == arr2[s] && arr1[sum - 1] != j) {
                        arr1[sum++] = j;
                        break;
                    }
                }else{
                    if (arr[j] == arr2[s]){
                        arr1[sum++] = j;
                        break;
                    }
                }
            }
               s--;
        }
        for(int i=0;i<N;i++){
            if(i!=N-1)
            System.out.print(arr1[i]+1+" ");
            else System.out.println(arr1[i]+1);
        }
    }


}
